import authRequest from "../supports/requests/authRequest";

export function getOrders(data) {
  return authRequest('orders/', { data: data })
}

export function getOrdersCounts() {
  return authRequest('orders/counts')
}

export function getOrder(id, data) {
  return authRequest('orders/' + id, { data: data })
}
export function getOrderItem(id) {
  return authRequest('order/item/' + id) 
}

export function createOrder(data) {
  return authRequest('orders', { method: 'post', data: data })
}

export function closeOrder(id) {
  return authRequest('orders/' + id + '/close', { method: 'post' })
}

export function cancelOrder(id) {
  return authRequest('orders/' + id + '/cancel', { method: 'post' })
}

export function receiveOrder(id) {
  return authRequest('orders/' + id + '/receive', { method: 'post' })
}

export function trackOrder(id) {
  return authRequest('orders/' + id + '/express')
}

export function getAftersaleReasons() {
  return authRequest('order/refunds/reasons')
}

export function createOrderRefund(data) {
  return authRequest('order/refunds', { method: 'post', data: data })
}

export function getOrderRefund(id) {
  return authRequest('order/refunds/' + id + '/show')
}

export function getOrderRefundNegos(id) {
  return authRequest('order/refunds/' + id + '/negos')
}
